
     /**
      * 弹窗 客服咨询js
      */
     var head = document.getElementsByTagName('head')[0];
     var link = document.createElement('link');
     link.type='text/css';
     link.rel = 'stylesheet';
     link.href ='{$url}/static/im/style1/css/chatStyle.css';
     head.appendChild(link);

     var blzx ={
         visiter_id:(typeof ai_service=='undefined' || typeof ai_service.visiter_id == 'undefined')?'':ai_service.visiter_id,
         visiter_name:(typeof ai_service=='undefined' || typeof ai_service.visiter_name == 'undefined')?'':ai_service.visiter_name,
         avatar:(typeof ai_service=='undefined' || typeof ai_service.avatar == 'undefined')?'':ai_service.avatar,
         product:(typeof ai_service=='undefined' || typeof ai_service.product == 'undefined')?'{}':JSON.stringify(ai_service.product),
         open:function(){
             var d =document.getElementById('blzxMinChatWindowDiv');
             if(!d){
                 var div =document.createElement('div');
                 div.id ='blzxMinChatWindowDiv';
                 document.body.appendChild(div);
                 var w =document.getElementById('blzxMinChatWindowDiv');
                 w.innerHTML='<div id="minblzxmsgtitlecontainer"><img id="minblzxWinlogo" src="{$url}/static/im/style1/img/wechatLogo.png"><div id="minblzxmsgtitlecontainerlabel" onclick="blzx.connenct(0)">在线咨询</div><img id="minblzxmsgtitlecontainerclosebutton" onclick="blzx.closeMinChatWindow(\'blzxMinChatWindowDiv\');" src="{$url}/static/im/style1/img/closewin.png"><img id="minblzxNewBigWin" onclick="blzx.connenct(0)" src="{$url}/static/im/style1/img/up_arrow.png"></div>';
                 document.getElementById('minblzxmsgtitlecontainer').style.backgroundColor='{$xfbg}';
             }
         },
         connenct:function(groupid){
             document.getElementById('blzxMinChatWindowDiv').style.display="none";
             var web =encodeURI('{$url}/im/web?app_key={$app_key}&{$theme}visiter_id='+blzx.visiter_id+'&visiter_name='+blzx.visiter_name+'&avatar='+blzx.avatar+'&groupid='+groupid+'&product='+blzx.product);

             //                      var mobileweb = encodeURI('{$url}/im/m?app_key={$app_key}&{$theme}visiter_id='+blzx.visiter_id+'&visiter_name='+blzx.visiter_name+'&avatar='+blzx.avatar+'&app_key={$app_key}&groupid='+groupid+'&product='+blzx.product);
             var s =document.getElementById('wolive-talk');

             if(!s){

                 var div = document.createElement('div');
                 div.id ='wolive-talk';
                 div.name=groupid;
                 if(blzx.isMobile()){
                     div.style.width='100%';
                     {$mheight}
                 }
                 document.body.appendChild(div);
                 div.innerHTML='<i class="blzx-close" onclick="blzx.closeMinChatWindow(\'wolive-talk\')"></i><iframe id="wolive-iframe" src="'+web+'"></iframe>'

             }else{

                 var title =s.name;
                 if(title == groupid){
                     s.style.display ='block';
                 }else{
                     s.parentNode.removeChild(s);
                     blzx.connenct(groupid);
                 }
             }

         },closeMinChatWindow:function(id){
             document.getElementById(id).style.display="none";
             if(id==='wolive-talk'){
                 document.getElementById('blzxMinChatWindowDiv').style.display="block";
             }
         },isMobile:function(){
             if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
                 return true;
             }else{
                 return false;
             }
         }
     }

     window.onload =blzx.open();
     {$isopen}


